/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('baby_activity', {
		id: {
			type: DataTypes.STRING(50),
			allowNull: false,
			primaryKey: true
		},
		create_time: {
			type: DataTypes.DATE,
			allowNull: true,
			defaultValue: sequelize.literal('CURRENT_TIMESTAMP')
		},
		start_time: {
			type: DataTypes.DATE,
			allowNull: true
		},
		end_time: {
			type: DataTypes.DATE,
			allowNull: true
		},
		title: {
			type: DataTypes.STRING(200),
			allowNull: true
		},
		main_banner: {
			type: DataTypes.STRING(200),
			allowNull: true
		},
		total_join: {
			type: DataTypes.INTEGER(11),
			allowNull: true,
			defaultValue: '0'
		},
		total_vote: {
			type: DataTypes.INTEGER(11),
			allowNull: true,
			defaultValue: '0'
		},
		total_visit: {
			type: DataTypes.INTEGER(11),
			allowNull: true,
			defaultValue: '0'
		},
		notice: {
			type: DataTypes.STRING(400),
			allowNull: true
		},
		rules: {
			type: DataTypes.JSON,
			allowNull: true
		},
		goods: {
			type: DataTypes.JSON,
			allowNull: true
		},
		about: {
			type: DataTypes.JSON,
			allowNull: true
		}
	}, {
		tableName: 'baby_activity',
		timestamps: false,
		freezeTableName: true
	});
};
